﻿$(function () {
    $("#txtPurchaseDate").datepicker($.datepicker.regional["zh-TW"]).datepicker("option", "dateFormat", "yy-mm-dd");
    $("#txtBirthday").datepicker($.datepicker.regional["zh-TW"]).datepicker("option", "dateFormat", "yy-mm-dd");

    $("#linkRule").tooltip({
        hide: {
            effect: "explode",
            delay: 250
        }
    });
    $("#open-event").tooltip({
        show: null,
        position: {
            my: "left top",
            at: "left bottom"
        },
        open: function (event, ui) {
            ui.tooltip.animate({ top: ui.tooltip.position().top + 10 }, "fast");
        }
    });

    //yuan/jin
    $("#cbUnitName1").change(function () {
        if (this.checked) {
            $("#spanUnitName").text("元/斤");
            $("#cbUnitName2").attr("checked", false);
            hogUnitName = 1;
        } else {
            $("#spanUnitName").text("元/斤");
            $("#cbUnitName2").attr("checked", true);
            hogUnitName = 0;
        }
    });
    //yuan/zhi
    $("#cbUnitName2").change(function () {
        if (this.checked) {
            $("#spanUnitName").text("元/只");
            $("#cbUnitName1").attr("checked", false);
            hogUnitName = 0;
        } else {
            $("#spanUnitName").text("元/斤");
            $("#cbUnitName1").attr("checked", true);
            hogUnitName = 1;
        }
    });



 });